/**
 * Created by loso on 2017/3/18.
 */
public class _1_TwoSum {


    public int[] twoSum(int[] nums, int target) {
            int dec = 0;
            int index;
        for (int i = 0; i < nums.length; i++) {
            dec = target - nums[i];
            index = i;
            for (int j = i+1; j < nums.length; j++) {
                if (nums[j] == dec){
                    return new int[]{index,j};
                }
            }
        }
        return null;
        }
}
